using System;
using System.Data;
using System.Collections.Generic;
using ADOBase;
namespace eTMS.DAO{
	/********************************BEGIN MonHocDAO****************************************/
	///<summary>
	/// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
	/// <para>Date:26/10/2011 34:05:09</para>
	/// <para>Class Name: MonHocDAO</para>
	/// <para>Description: Class access to table MonHoc in database. Coder should'nt code here.</para>
	///</summary>

	
	public partial class MonHocDAO : DAOBase<MonHocEntity>{


		#region Select functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectOneCommand</para>
		/// <para>Input: MonHoc_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectOneCommand(int MonHoc_ID){
			string strSQL="SELECT  [MonHoc_ID],[MaMonHoc],[TenMonHoc],[SoHocPhan],[SoHocPhanHocPhi],[SoTietHoc],[MoTa],[BoMon_ID] FROM [MonHoc]  WHERE [MonHoc].[MonHoc_ID]=@MonHoc_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@MonHoc_ID",MonHoc_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectOne</para>
		/// <para>Input: MonHoc_ID</para>
		/// <para>Output: MonHocEntity</para>
		///</summary>
		public MonHocEntity SelectOne(int MonHoc_ID){
			IDbCommand cmd=this.CreateSelectOneCommand(MonHoc_ID);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectOneByMaMonHoc</para>
		/// <para>Input: MaMonHoc</para>
		/// <para>Output: MonHocEntity</para>
		///</summary>
		public MonHocEntity SelectOneByMaMonHoc(string MaMonHoc){
			IDbCommand cmd=this.CreateSelectAllByKeyCommand("MaMonHoc",MaMonHoc);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllCommand(){
			string strSQL="SELECT  [MonHoc_ID],[MaMonHoc],[TenMonHoc],[SoHocPhan],[SoHocPhanHocPhi],[SoTietHoc],[MoTa],[BoMon_ID] FROM [MonHoc] ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllByKeyCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyCommand(string ColumnName,object Value){
			string strSQL="SELECT  [MonHoc_ID],[MaMonHoc],[TenMonHoc],[SoHocPhan],[SoHocPhanHocPhi],[SoTietHoc],[MoTa],[BoMon_ID] FROM [MonHoc]  WHERE [MonHoc].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of MonHocEntity</para>
		///</summary>
		public List<MonHocEntity> SelectAll(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAllDS</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDS(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllFilterCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllFilterCommand(string strFilter){
			string strSQL="SELECT  [MonHoc_ID],[MaMonHoc],[TenMonHoc],[SoHocPhan],[SoHocPhanHocPhi],[SoTietHoc],[MoTa],[BoMon_ID] FROM [MonHoc]  WHERE "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllByKeyFilterCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyFilterCommand(string strFilter,string ColumnName,object Value){
			string strSQL="SELECT  [MonHoc_ID],[MaMonHoc],[TenMonHoc],[SoHocPhan],[SoHocPhanHocPhi],[SoTietHoc],[MoTa],[BoMon_ID] FROM [MonHoc]  WHERE [MonHoc].["+ColumnName+"]=@ColumnName AND "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of MonHocEntity</para>
		///</summary>
		public List<MonHocEntity> SelectAllFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAllDSFilter</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectDS(cmd);
		}
		#endregion

		#region Insert functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateInsertCommand</para>
		/// <para>Input: MonHocEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateInsertCommand(MonHocEntity o){
			string strSQL="INSERT INTO [MonHoc]([MaMonHoc],[TenMonHoc],[SoHocPhan],[SoHocPhanHocPhi],[SoTietHoc],[MoTa],[BoMon_ID]) VALUES  (@MaMonHoc,@TenMonHoc,@SoHocPhan,@SoHocPhanHocPhi,@SoTietHoc,@MoTa,@BoMon_ID);SELECT  @@IDENTITY";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullMaMonHoc)
				this.CreateCommandParameter(cmd,"@MaMonHoc",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MaMonHoc",o.MaMonHoc);

			if(o.IsNullTenMonHoc)
				this.CreateCommandParameter(cmd,"@TenMonHoc",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TenMonHoc",o.TenMonHoc);

			if(o.IsNullSoHocPhan)
				this.CreateCommandParameter(cmd,"@SoHocPhan",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SoHocPhan",o.SoHocPhan);

			if(o.IsNullSoHocPhanHocPhi)
				this.CreateCommandParameter(cmd,"@SoHocPhanHocPhi",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SoHocPhanHocPhi",o.SoHocPhanHocPhi);

			if(o.IsNullSoTietHoc)
				this.CreateCommandParameter(cmd,"@SoTietHoc",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SoTietHoc",o.SoTietHoc);

			if(o.IsNullMoTa)
				this.CreateCommandParameter(cmd,"@MoTa",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MoTa",o.MoTa);

			if(o.IsNullBoMon_ID)
				this.CreateCommandParameter(cmd,"@BoMon_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@BoMon_ID",o.BoMon_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Save</para>
		/// <para>Input: MonHocEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Save(MonHocEntity o){
			bool result=false;
			IDbCommand cmd=this.CreateInsertCommand(o);
			object id=this.ExecuteScalar(cmd,ref result);
			cmd.Dispose();
			try{
				o.MonHoc_ID=int.Parse(Convert.ToString(id));
			}
			catch{}
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SaveList</para>
		/// <para>Input: List of MonHocEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void SaveList(List<MonHocEntity>list){
			foreach(MonHocEntity o in list){
				try{
					this.Save(o);
				}
				catch{
				}
			}
		}
		#endregion

		#region Update functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateUpdateCommand</para>
		/// <para>Input: MonHocEntity</para>
		/// <para>Output: </para>
		///</summary>
		protected IDbCommand CreateUpdateCommand(MonHocEntity o){
			string strSQL="UPDATE  [MonHoc] SET [MonHoc].[MaMonHoc]=@MaMonHoc,[MonHoc].[TenMonHoc]=@TenMonHoc,[MonHoc].[SoHocPhan]=@SoHocPhan,[MonHoc].[SoHocPhanHocPhi]=@SoHocPhanHocPhi,[MonHoc].[SoTietHoc]=@SoTietHoc,[MonHoc].[MoTa]=@MoTa,[MonHoc].[BoMon_ID]=@BoMon_ID WHERE [MonHoc].[MonHoc_ID]=@MonHoc_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullMonHoc_ID)
				this.CreateCommandParameter(cmd,"@MonHoc_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MonHoc_ID",o.MonHoc_ID);

			if(o.IsNullMaMonHoc)
				this.CreateCommandParameter(cmd,"@MaMonHoc",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MaMonHoc",o.MaMonHoc);

			if(o.IsNullTenMonHoc)
				this.CreateCommandParameter(cmd,"@TenMonHoc",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TenMonHoc",o.TenMonHoc);

			if(o.IsNullSoHocPhan)
				this.CreateCommandParameter(cmd,"@SoHocPhan",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SoHocPhan",o.SoHocPhan);

			if(o.IsNullSoHocPhanHocPhi)
				this.CreateCommandParameter(cmd,"@SoHocPhanHocPhi",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SoHocPhanHocPhi",o.SoHocPhanHocPhi);

			if(o.IsNullSoTietHoc)
				this.CreateCommandParameter(cmd,"@SoTietHoc",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SoTietHoc",o.SoTietHoc);

			if(o.IsNullMoTa)
				this.CreateCommandParameter(cmd,"@MoTa",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MoTa",o.MoTa);

			if(o.IsNullBoMon_ID)
				this.CreateCommandParameter(cmd,"@BoMon_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@BoMon_ID",o.BoMon_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateUpdateFieldCommand</para>
		/// <para>Input: ColumnName,ColumnValue,MonHoc_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateUpdateFieldCommand(string ColumnName,object Value,int MonHoc_ID){
			string strSQL="UPDATE  [MonHoc] SET [MonHoc].["+ColumnName+"]=@ColumnName WHERE [MonHoc].[MonHoc_ID]=@MonHoc_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@MonHoc_ID",MonHoc_ID);



			this.CreateCommandParameter(cmd,"@ColumnName",Value);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Update</para>
		/// <para>Input: MonHocEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Update(MonHocEntity o){
			IDbCommand cmd=this.CreateUpdateCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateList</para>
		/// <para>Input: List of MonHocEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void UpdateList(List<MonHocEntity>list){
			foreach(MonHocEntity o in list){
				try{
					this.Update(o);
				}
				catch{
				}
			}
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateMaMonHoc</para>
		/// <para>Input: NewMaMonHoc,MonHoc_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateMaMonHoc(string NewMaMonHoc,int MonHoc_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("MaMonHoc",NewMaMonHoc,MonHoc_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateTenMonHoc</para>
		/// <para>Input: NewTenMonHoc,MonHoc_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTenMonHoc(string NewTenMonHoc,int MonHoc_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TenMonHoc",NewTenMonHoc,MonHoc_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateSoHocPhan</para>
		/// <para>Input: NewSoHocPhan,MonHoc_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSoHocPhan(Decimal NewSoHocPhan,int MonHoc_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("SoHocPhan",NewSoHocPhan,MonHoc_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateSoHocPhanHocPhi</para>
		/// <para>Input: NewSoHocPhanHocPhi,MonHoc_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSoHocPhanHocPhi(Decimal NewSoHocPhanHocPhi,int MonHoc_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("SoHocPhanHocPhi",NewSoHocPhanHocPhi,MonHoc_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateSoTietHoc</para>
		/// <para>Input: NewSoTietHoc,MonHoc_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSoTietHoc(Decimal NewSoTietHoc,int MonHoc_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("SoTietHoc",NewSoTietHoc,MonHoc_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateMoTa</para>
		/// <para>Input: NewMoTa,MonHoc_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateMoTa(string NewMoTa,int MonHoc_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("MoTa",NewMoTa,MonHoc_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateBoMon_ID</para>
		/// <para>Input: NewBoMon_ID,MonHoc_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateBoMon_ID(int NewBoMon_ID,int MonHoc_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("BoMon_ID",NewBoMon_ID,MonHoc_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Delete functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteAllCommand(){
			string strSQL="DELETE   FROM [MonHoc]  ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteCommand</para>
		/// <para>Input: MonHocEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteCommand(MonHocEntity o){
			string strSQL="DELETE   FROM [MonHoc]   WHERE [MonHoc].[MonHoc_ID]=@MonHoc_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullMonHoc_ID)
				this.CreateCommandParameter(cmd,"@MonHoc_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@MonHoc_ID",o.MonHoc_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteAll</para>
		/// <para>Input: </para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteAll(){
			IDbCommand cmd=this.CreateDeleteAllCommand();
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateDeleteByPrimaryKeyCommand</para>
		/// <para>Input: MonHoc_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByPrimaryKeyCommand(int MonHoc_ID){
			string strSQL="DELETE   FROM [MonHoc]   WHERE [MonHoc].[MonHoc_ID]=@MonHoc_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@MonHoc_ID",MonHoc_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateDeleteByKeyCommand</para>
		/// <para>Input: ColumnName , ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByKeyCommand(string ColumnName,object Value){
			string strSQL="DELETE   FROM [MonHoc]   WHERE [MonHoc].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Delete</para>
		/// <para>Input: MonHocEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Delete(MonHocEntity o){
			IDbCommand cmd=this.CreateDeleteCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteByID</para>
		/// <para>Input: MonHoc_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByID(int MonHoc_ID){
			IDbCommand cmd=this.CreateDeleteByPrimaryKeyCommand(MonHoc_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select join to BoMon functions
		#endregion

		#region Select,delete by MonHoc_ID functions
		#endregion

		#region Select,delete by BoMon_ID functions
		#endregion

		#region MapObject functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: MapObject</para>
		/// <para>Input: IDataReader</para>
		/// <para>Output: MonHocEntity</para>
		///</summary>
		protected override MonHocEntity MapObject(IDataReader r){
			MonHocEntity entity = new MonHocEntity();
			try{
				if(r.FieldCount>0){
					try
					{
						int ordinal = r.GetOrdinal("MonHoc_ID");
						if (!r.IsDBNull(ordinal)) entity.MonHoc_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("MaMonHoc");
						if (!r.IsDBNull(ordinal)) entity.MaMonHoc = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TenMonHoc");
						if (!r.IsDBNull(ordinal)) entity.TenMonHoc = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("SoHocPhan");
						if (!r.IsDBNull(ordinal)) entity.SoHocPhan = (Convert.ToDecimal(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("SoHocPhanHocPhi");
						if (!r.IsDBNull(ordinal)) entity.SoHocPhanHocPhi = (Convert.ToDecimal(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("SoTietHoc");
						if (!r.IsDBNull(ordinal)) entity.SoTietHoc = (Convert.ToDecimal(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("MoTa");
						if (!r.IsDBNull(ordinal)) entity.MoTa = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("BoMon_ID");
						if (!r.IsDBNull(ordinal)) entity.BoMon_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					return entity;
				}
			}catch{}
			return null;
		}
		#endregion
	}
	/*****************************************************************************************************/
	/**********************************END MonHocDAOBase*****************************************/
	/*****************************************************************************************************/
}

